package com.enfry.storage.api;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

import com.alibaba.fastjson.JSON;
import com.enfry.storage.common.Constants;

public class BaseStorageFileServ extends BaseApi implements IBaseStorageFile {


	@Override
	public void batchInsertBaseStorageFile(Map<String, Object> ... baseStorageFileMap){
		logger.info("batchInsertBaseStorageFile=====>"+JSON.toJSONString(baseStorageFileMap));
		if(baseStorageFileMap!=null&&baseStorageFileMap.length>0){
			this.sqlMap.insert("storage.file.batchInsertBaseStorageFile", Arrays.asList(baseStorageFileMap));
		}
	}
	
	@Override
	public void insertBaseStorageFile(String relativePath,String absolutePath){
		Map<String, Object> baseStorageFileMap = new HashMap<String, Object>();
		baseStorageFileMap.put("id", idWorker.nextStringId());
		baseStorageFileMap.put("relativePath", relativePath);
		baseStorageFileMap.put("absolutePath", absolutePath);
		baseStorageFileMap.put("deteteFlag", Constants.deteteFlag_1);
		baseStorageFileMap.put("isServiceFile", Constants.isServiceFile_0);
		this.batchInsertBaseStorageFile(baseStorageFileMap);
	}
}
